package cn.rui.controller;

import cn.rui.aop.Log;
import cn.rui.pojo.SysLog;
import cn.rui.service.SyLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 日志控制器
 *
 * @author 徽州大都督
 * @date 2020/8/14
 */
@RestController
@RequestMapping("log")
public class LogController {


    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    private SyLogService syLogService;


    /**
     * 分页查询日志
     *
     * @param page
     * @param size
     * @return
     */
    @GetMapping("findByPage/{page}/{size}")
    public List<SysLog> findByPage(@PathVariable("page") int page, @PathVariable("size") int size) {
        return syLogService.findByPage (page, size);
    }



}
